using SDL;

abstract class GameObject : Object {
	public Cuboid dimensions { get; set; }
	public Point position { get; set; }
	public Window window { get; protected set; }
	public World world { get; protected set; }

	// Simple check if rectangles intersect
	public bool collides_with(GameObject other) {
		return (this.position.X < (other.position.X + other.dimensions.width)
		 	&& (this.position.X + this.dimensions.width) > other.position.X
			&& this.position.Y < (other.position.Y + other.dimensions.height)
			&& (this.position.Y + this.dimensions.height) > other.position.Y
			&& this.position.Z < (other.position.Z + other.dimensions.depth)
			&& (this.position.Z + this.dimensions.depth) > other.position.Z);
	}

	public abstract void render(Surface surface);
}

